<?php
/**
 * Created by PhpStorm.
 * User: liuhong
 * Date: 2018/7/30
 * Time: 下午4:35
 */

namespace app\common\service;


use app\common\model\MeetingModel;
use think\Exception;

class MeetingService extends BaseService
{

    public $meetingModel;
    public function __construct()
    {
        $this->meetingModel=new MeetingModel();
    }

    /**新建会议
     * @param $add
     * @return false|int
     */
    public function addMeeting($add){
        $add['create_time']=date('Y-m-d H:i:s');
        return $this->meetingModel->insertGetId($add);
    }
    //修改签到信息
    public function saveMeeting($id,$save){
        try{
            return $this->meetingModel->where('id',$id)->update($save);
        }catch (Exception $ex){
            echo '异常错误'.$ex->getMessage();
            return false;
        }
    }

    /**
     * @param $where
     * @return array|bool|false|\PDOStatement|string|\think\Model
     */
    public function queryMeeting($where){
        try{
            return $this->meetingModel->where($where)->find();
        }catch (Exception $ex){
            echo 'Exception';
            return false;
        }
    }



}